CREATE TABLE [dbo].[TCAMAR_CPIN]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCAMAR_CP__NU_PR__1CF15040] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TCAMAR_CP__CO_US__1DE57479] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TCAMAR_CP__FE_US__1ED998B2] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCAMAR_CP__CO_US__1FCDBCEB] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCAMAR_CP__FE_US__20C1E124] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_CPIN] ADD CONSTRAINT [PK__TCAMAR_C__DB895B805BC376B8] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_AMAR], [CO_UNID_CONC], [FE_AMAR], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_CPIN] ADD CONSTRAINT [FK__TCAMAR_CPIN__6CA3E9F7] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) REFERENCES [dbo].[TCAMAR_CPAG] ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR])
GO
